<script type="text/javascript" src="<?php echo $CONFIG->wwwroot . 'mod/tidypics/vendors/lytebox/lytebox.js'; ?>"></script>
<link rel="stylesheet" href="<?php echo $CONFIG->wwwroot . 'mod/tidypics/vendors/lytebox/lytebox.css'; ?>" type="text/css" />
<link rel="stylesheet" href="<?php echo $CONFIG->wwwroot . 'mod/tidypics_lightbox/lightbox.css'; ?>" type="text/css" />


<?php
	/**
	 * Elgg view - product image
	 * 
	 * @package Elgg SocialCommerce
	 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
	 * @author Cubet Technologies
	 * @copyright Cubet Technologies 2009-2010
	 * @link http://elgghub.com/
 	**/ 


	global $CONFIG;

	$stores = $vars['entity'];
	$image = $vars['image'];
	
	
	if ($stores instanceof ElggEntity) {
	//print_r($vars['size']);
		// Get size 
		if (!in_array($vars['size'],array('small','medium','large','tiny','master','topbar')))
			$vars['size'] = "medium";
			
			
			
		// Get display
		if (!in_array($vars['display'],array('full','image','url'))){
			$vars['display'] = "full";
		}
			
		// Get any align and js
		if (!empty($vars['align'])) {
			$align = " align=\"{$vars['align']}\" ";
		} else {
			$align = "";
		}
		
		if ($icontime = $vars['entity']->icontime) {
			$icontime = "{$icontime}";
		} else {
			$icontime = "default";
		}

		if($vars['display'] == "full"){
?>




			<?php /*
			<script>
				function display_zoome_image(guid,e){
					$("#zome_product_image_"+guid).css('display','block');
				}
				function hide_zoome_image(guid){
					$("#zome_product_image_"+guid).css('display','none');
				
			</script>}*/ ?>

			<a href="<?php echo $vars['entity']->getURL(); ?>" class="icon" >
			<div style="background: url(<?php echo $CONFIG->url; ?>pg/storesimage/<?php echo $stores->guid; ?>/<?php echo $image['path']; ?>/medium/<?php echo $stores->icontime; ?>.jpg) center; height: 100%">
			
				
			</div></a>
			<div id="zome_product_image_<?php echo $vars['entity']->guid; ?>" class="zome_product_image">
				<img src="<?php echo $CONFIG->url; ?>pg/storesimage/<?php echo $stores->guid; ?>/<?php echo $image['path']; ?>/medium/<?php echo $stores->icontime; ?>.jpg">
			</div>
<?php
		}else if ($vars['display'] == "image"){
			//here output the title image
			if($vars['size'] == 'large'){
			
?>
<img title="<?php echo $vars['entity']->title; ?>" src="<?php echo $CONFIG->url; ?>pg/storesimage/<?php echo $stores->guid; ?>/<?php echo $image['path']; ?>/<?php echo $vars['size']; ?>/<?php echo $stores->icontime; ?>.jpg" border="0" <?php echo $align; ?> title="<?php echo $name; ?>" <?php echo $vars['js']; ?> />
<?php				
			}
			else if ($vars['size'] == 'medium'){		
			
			//for ($x = 1; $x < count($images); $x++){
		
			//SET UP THE LINK TO LIGHTBOX
		//$image_html = trigger_plugin_hook('tp_thumbnail_link', 'album', array('image' => $image, 'title' => $vars['entity']->title, 'guid' => $stores->guid, 'size' => $vars['size'], 'icontime' => $stores->icontime, 'align' => $align, 'name' => $name, 'js' => $vars['js']), $image_html);	
		$image_html = trigger_plugin_hook('tp_thumbnail_link', 'album', array('stores' => $stores, 'image' => $image['path']), $image_html);						
		echo $image_html;

				//}
			}
			else{
				?>
			<img border="0" src="<?php echo $CONFIG->url; ?>pg/storesimage/<?php echo $stores->guid; ?>/<?php echo $image['path']; ?>/<?php echo $vars['size']; ?>/<?php echo $stores->icontime; ?>.jpg" title="<?php echo $vars['entity']->title; ?>" />
		
			<?php 	
			}
		}else if ($vars['display'] == "url"){
			echo $vars['entity']->getIcon($vars['size']); 
		}
	}
	
?>

